Page({
  data: {
    projectId: null,
    projectInfo: null,
    commissionList: []
  },
  
  onLoad: function(options) {
    const projectId = options.id;
    this.setData({
      projectId: projectId
    });
    
    this.getProjectDetail(projectId);
    this.getCommissionDetail(projectId);
  },
  
  // 获取项目详情
  getProjectDetail: function(projectId) {
    // 模拟从服务器获取数据
    wx.request({
      url: `https://api.example.com/projects/${projectId}`,
      success: (res) => {
        this.setData({
          projectInfo: res.data
        });
      }
    });
  },
  
  // 获取提成明细
  getCommissionDetail: function(projectId) {
    // 模拟从服务器获取数据
    wx.request({
      url: `https://api.example.com/projects/${projectId}/commission`,
      success: (res) => {
        this.setData({
          commissionList: res.data.commissions
        });
      }
    });
  }
})